package com.project.shiro;

import org.apache.shiro.authz.AuthorizationException;
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class PermittedPress {
    @ExceptionHandler({AuthorizationException.class,
            UnauthorizedException.class})
    public String press() {
        return "不好意思，你没有这个权限！";
    }
}
